/*
 * @Author: shanghongyun 2879455630@qq.com
 * @Date: 2025-05-30 16:43:22
 * @LastEditors: shanghongyun 2879455630@qq.com
 * @LastEditTime: 2025-06-20 18:47:31
 * @FilePath: \A05\Drive\key.h
 * @Description: 按键头文件
 */
#ifndef __KEY_H_
#define __KEY_H_



//#include "NM1120.h"
#include "Base.h"
#include "dev.h"


#define SHORT_PRESS_TIME        10              /*短按消抖时间 :10ms*/
#define LONG_PRESS_TIME_MAX     1000            /*长按最大时间 :10ms*/
#define LONG_PRESS_TIME_MIN     100             /*长按最小时间 :10ms*/

typedef struct{
    uint32_t press_time;
    uint16_t short_press_time ;
    uint16_t long_press_time_max;
    uint16_t long_press_time_min;
    uint8_t long_lock;
    uint8_t long_flag;
    uint8_t short_flag;
    uint8_t short_wait;
    uint8_t long_effect;        /*长按有效*/
    uint8_t (*get_key_value)(void);
}key_t;


void Key_detect(key_t *pkey);

uint8_t get_key_L(void) , get_key_R(void);

#endif


